﻿namespace Preactor.ObjectModel.BaseTypes.MaterialControl
{
    using System;

    using Preactor.ObjectModel.Attributes;
    using Preactor.ObjectModel.Entities;
    using Preactor.ObjectModel.Interfaces.MaterialControl;

    public class BillOfMaterial : PreactorRecord, IBillOfMaterial
    {
        public BillOfMaterial(PrimaryKey id, PreactorObjectModel preactorObjectModel)
            : base(id, preactorObjectModel)
        {
        }

        [PreactorField("BILL OF MATERIALS TABLE", FieldDeclarationType.FieldClassification)]
        public int Number { get { return (int)GetValue("Number"); } set { SetValue("Number", value); } }

        [PreactorField("Order No.", FieldDeclarationType.FieldClassification)]
        public string OrderNumber { get { return (string)GetValue("OrderNumber"); } set { SetValue("OrderNumber", value); } }

        [PreactorField("Op. No.", FieldDeclarationType.FieldClassification)]
        public int OperationNumber { get { return (int)GetValue("OperationNumber"); } set { SetValue("OperationNumber", value); } }

        [PreactorField("REQUIRED PART NO", FieldDeclarationType.FieldClassification)]
        public string RequiredPartNumber { get { return (string)GetValue("RequiredPartNumber"); } set { SetValue("RequiredPartNumber", value); } }

        [PreactorField("REQUIRED QUANTITY", FieldDeclarationType.FieldClassification)]
        public double RequiredQuantity { get { return (double)GetValue("RequiredQuantity"); } set { SetValue("RequiredQuantity", value); } }

        [PreactorField("QUANTITY PER UNIT", FieldDeclarationType.FieldClassification)]
        public bool MultiplyByOrderQuantity { get { return (bool)GetValue("MultiplyByOrderQuantity"); } set { SetValue("MultiplyByOrderQuantity", value); } }

        [PreactorField("IGNORE SHORTAGE", FieldDeclarationType.FieldClassification)]
        public bool IgnoreShortages { get { return (bool)GetValue("IgnoreShortages"); } set { SetValue("IgnoreShortages", value); } }

        [PreactorField("PEGGING MULTIPLE", FieldDeclarationType.FieldClassification)]
        public int MultipleQuantity { get { return (int)GetValue("MultipleQuantity"); } set { SetValue("MultipleQuantity", value); } }

        [PreactorField("Import Marker", FieldDeclarationType.FieldClassification)]
        public int ImportMarker { get { return (int)GetValue("ImportMarker"); } set { SetValue("ImportMarker", value); } }
    }
}